const mysql = require("mysql");

let pool = mysql.createPool({
    host:"192.168.174.166",
    user:"root",
    password:"ddd",
    database:"baiShou"
})

module.exports={
    query:(sql,args)=>{
        let p = new Promise((resolve,reject)=>{
            pool.query(sql,[...args],(err,res,fields)=>{
                if(err){
                    reject(err)
                }else{
                    resolve(res)
                }
            })
        })
        return p;
    }
}